


var untils = {
    'baseUrl':'',
    'request':function (options) {
        var url = this.baseUrl + options.url;
        return new Promise(function (resolve, reject) {
            $.ajax({
                url:      url,
                data:     options.data,
                header:   options.header ? options.header : 'application/json',
                method:   options.method ? options.method : 'POST',
                dataType: options.dataType ? options.dataType : 'JSON',
                success:  function (res) {
                    res.code == 1 ? resolve(res) : res.url = options.url,reject(res);
                }
            })
        })

    }
}

